package top.lyjwn.todo.webSocket.data;

import java.util.Date;

/**
 * 消息，websocket的消息模板
 *
 * @author luoyujie
 */
public class Message {

    /**
     * 消息id(服务器)
     */
    private String messageServerId;

    /**
     * 消息id(客户端)
     */
    private String messageClientId;

    /**
     * 消息类型
     */
    private int type;

    /**
     * 消息发送方
     */
    private WebSocketUser sender;

    /**
     * 消息接收方
     */
    private WebSocketUser receiver;

    /**
     * 消息内容
     */
    private Content content;

    /**
     * 是否已读
     */
    private boolean isRead;

    /**
     * 发送时间
     */
    private Date senderTime;

    /**
     * 接收时间
     */
    private Date receiverTime;


    public Message(String messageClientId, WebSocketUser sender, WebSocketUser receiver, int type) {
        this.messageClientId = messageClientId;
        this.sender = sender;
        this.receiver = receiver;
        this.type = type;
    }

    public String getMessageServerId() {
        return messageServerId;
    }

    public void setMessageServerId(String messageServerId) {
        this.messageServerId = messageServerId;
    }

    public String getMessageClientId() {
        return messageClientId;
    }

    public void setMessageClientId(String messageClientId) {
        this.messageClientId = messageClientId;
    }

    public WebSocketUser getSender() {
        return sender;
    }

    public void setSender(WebSocketUser sender) {
        this.sender = sender;
    }

    public WebSocketUser getReceiver() {
        return receiver;
    }

    public void setReceiver(WebSocketUser receiver) {
        this.receiver = receiver;
    }

    public Content getContent() {
        return content;
    }

    public void setContent(Content content) {
        this.content = content;
    }

    public boolean isRead() {
        return isRead;
    }

    public void setRead(boolean read) {
        isRead = read;
    }

    public Date getSenderTime() {
        return senderTime;
    }

    public void setSenderTime(Date senderTime) {
        this.senderTime = senderTime;
    }

    public Date getReceiverTime() {
        return receiverTime;
    }

    public void setReceiverTime(Date receiverTime) {
        this.receiverTime = receiverTime;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }



    /**
     * 内容为文字
     */
    public final static int TEXT = 0;

    /**
     * 内容为图片
     */
    public final static int IMAGE = 1;

    /**
     * 已读的标记
     */
    public final static int READ = 2;

    /**
     * ping的回应
     */
    public final static int PONG = 3;


}
